package com.cn.domain;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 问卷与题关系表——问卷中有主观题和客观题，而问卷与这两类题的关系为多对多
 * @author Hang
 * @date 2016年3月16日上午11:37:06
 * @version
 */
@Table(name = "qrelationaltable")
@Entity
public class QRelationalTable {
	//问卷与题关系表
	@Id
	@GeneratedValue
	private int qtid;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "qtq_id")
	private Questionnaires qtQuestionnaires;
	
	//问卷与客观题表
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "qto_id")
	private ObjectiveQuestions qtObjectiveQuestions;
	
	//问卷与主观题表
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "qts_id")
	private SubjectiveQuestions qtSubjectiveQuestions;

	public QRelationalTable() {
		super();
	}

	public QRelationalTable(int qtid, Questionnaires qtQuestionnaires,
			ObjectiveQuestions qtObjectiveQuestions,
			SubjectiveQuestions qtSubjectiveQuestions) {
		super();
		this.qtid = qtid;
		this.qtQuestionnaires = qtQuestionnaires;
		this.qtObjectiveQuestions = qtObjectiveQuestions;
		this.qtSubjectiveQuestions = qtSubjectiveQuestions;
	}

	public int getQtid() {
		return qtid;
	}

	public void setQtid(int qtid) {
		this.qtid = qtid;
	}

	public Questionnaires getQtQuestionnaires() {
		return qtQuestionnaires;
	}

	public void setQtQuestionnaires(Questionnaires qtQuestionnaires) {
		this.qtQuestionnaires = qtQuestionnaires;
	}

	public ObjectiveQuestions getQtObjectiveQuestions() {
		return qtObjectiveQuestions;
	}

	public void setQtObjectiveQuestions(ObjectiveQuestions qtObjectiveQuestions) {
		this.qtObjectiveQuestions = qtObjectiveQuestions;
	}

	public SubjectiveQuestions getQtSubjectiveQuestions() {
		return qtSubjectiveQuestions;
	}

	public void setQtSubjectiveQuestions(SubjectiveQuestions qtSubjectiveQuestions) {
		this.qtSubjectiveQuestions = qtSubjectiveQuestions;
	}
	
}
